<template>
  <div id="app">
    <van-nav-bar
      :title="$store.state.title"
      left-text="返回"
      right-text=" "
      left-arrow
      @click-left="onClickLeft"
    />
    <router-view></router-view>
    <van-tabbar v-model="active" v-if="$store.state.Show">
      <van-tabbar-item icon="home-o" to="/home">主页</van-tabbar-item>
      <van-tabbar-item icon="search" dot to="/friends">朋友</van-tabbar-item>
      <van-tabbar-item icon="friends-o" dot to="/cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="setting-o" to="/search">搜索</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
    return {
      num: 0,
      active: 0,
    }
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1)
    }
  },
}
</script>

<style>
</style>
